﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LF3.Moduls;
using LF3.Repositories;

namespace LF3.Controllers
{
    public class LF_SchedulerController
    {
        LF_ScheduleRepository schedulerRep = new LF_ScheduleRepository();
        public IList<Lf_Schedule> GetNotStartSchedulers()
        {
            return schedulerRep.GetNotStartSchedulers();
        }

        public Lf_Schedule GetScheduleByID(int scheduleID)
        {
            return schedulerRep.GetSchedulerByID(scheduleID);
        }

        public string HeatAnnounce(Lf_Schedule schedule)
        {
            try
            {
                schedulerRep.HeatAnnounce(schedule.bofscheduleid);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            return "";
        }

        public string HeatCancelAnnounce(int scheduleID)
        {
            try
            {
                schedulerRep.HeatCancelAnnounce(scheduleID);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            return "";
        }

        public string HeatEnd(int scheduleID)
        {
            try
            {
                schedulerRep.HeatEnd(scheduleID);
            }
            catch (Exception ex)
            {
                return ex.Message;
            }
            return "";
        }
    }
}
